package LhtWebApi

import (
	"fmt"
	"lht-go-plugins/LhtWebApi/config"
	"lht-go-plugins/LhtWebApi/router"
)

func NewWebServer() {
	// 初始化 config
	if err := config.InitConfiguration(); err != nil {
		panic(err)
	}
	r := router.InitRoutes()
	cfg := config.Conf.WebServerConfig
	addr := fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)
	r.Run(addr)
}
